package com.wulee.notebook.db.db;

import android.arch.persistence.room.Database;
import android.arch.persistence.room.RoomDatabase;

import com.wulee.notebook.bean.Note;
import com.wulee.notebook.db.db.dao.NoteDao;

@Database(entities = { Note.class}, version = 1,exportSchema = false)
public abstract class AppDataBase extends RoomDatabase {

    public abstract NoteDao getNoteDao();

    //数据库变动添加Migration
//    static final Migration MIGRATION_1_2 = new Migration(2, 3) {
//        @Override
//        public void migrate(SupportSQLiteDatabase database) {
//            database.execSQL("CREATE TABLE IF NOT EXISTS `menstrual_blood` (`date` INTEGER PRIMARY KEY NOT NULL, `level` INTEGER NOT NULL)");
//            database.execSQL("CREATE TABLE IF NOT EXISTS `menstrual_record` (`start_date` INTEGER PRIMARY KEY NOT NULL, `end_date` INTEGER NOT NULL)");
//            database.execSQL("CREATE TABLE IF NOT EXISTS `pain` (`date` INTEGER PRIMARY KEY NOT NULL, `level` INTEGER NOT NULL)");
//        }
//    };
}
